<!doctype html>
<html>
<head>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<?php echo mate($seo);?>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/static/js/dropzone/css/dropzone.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/TemplateDefault/css/swiper.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/bootstrap/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/TemplateDefault/css/picbox.css">
<script src="__PUBLIC__/Admin/bootstrap/js/jquery.min.js"></script>
<script src="__PUBLIC__/Home/TemplateDefault/js/jquery.SuperSlide.2.1.1.js"></script>
<script src="__PUBLIC__/Admin/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/Home/TemplateDefault/js/swiper.min.js"></script>
<script src="__PUBLIC__/Home/TemplateDefault/js/picbox.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=QMDvD2Anle2gLOINIBUZ1Lhh">
</script>



</head>
<body>
<style>
body{background:#fff;}
.list-group {
	margin-bottom: 5px;
	
}
.pages {
	text-align: center;
}
a{color:#333;} 
.headernav a{font-size:1.5em; color:#000;}


.panel-heading {
    padding: 4px 7px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}
.panel{border-radius:0;}
.form-control {
    background-color: #FDFDFD;
}
</style>



<style>

#areabox select { 
	margin-bottom: 5px;
}
</style>




<div class="container" id="fbox"><empty name="info">
<!-- 填写信息前的协议 -->
<div style="padding-bottom:60px; padding:20px;">
  <include file="Supplier:text"/>
</div>
<div style="position:fixed; bottom:0; padding-bottom:10px; padding-top:10px; background:#fff; left:0; width:100%;"><a href="##" style="display:block; width:80%; margin:0 auto;" onClick="showform();" class="btn btn-success">我同意</a></div>
<else/>



<table width="100%" class="table" border="0" cellspacing="0" cellpadding="0" style="margin-top:25px;">
  <tbody>
  <tr>
      <td style="border-top:none;">状态</td>
      <td style="border-top:none;"><eq name="info['status']" value="0">审核中<else/>已通过审核</eq></td>
    </tr> 
    <tr>
      <td>联系人</td>
      <td>{$info.contacts}</td>
    </tr>
    <tr>
      <td>联系电话</td>
      <td>{$info.sphone}</td>
    </tr>
    <tr>
      <td>地址</td>
      <td>{$info.saddress}</td>
    </tr>
    <tr>
      <td>营业执照</td>
      <td><img src="__PUBLIC__{$info['licence']}" width="100"></td>
    </tr>
  </tbody>
</table>

<a style="display:block; width:80%; margin:0 auto;" href="##" class="btn btn-success" onClick="showform();">修改信息</a>


<!-- 审核状态，可以修改信息 -->
</empty></div>






<div id="formbox" style="display:none;"><img src="/Public/Admin/eh/557931800b08c.jpg" width="100%" alt="" style="border-bottom:2px solid #FFBBA7;"/>
<div class="container" style="padding-top:20px;">





  <form class="checkoutform form-horizontal" action="{:U('update')}" method="post" callback="reload">
      <input type="hidden" name="id" value="{$info.id}">
      <input type="hidden" name="top_id" value="<?php echo $_GET['aff_id']?>">
    <div class="form-group">
      <label class="control-label col-sm-2">商家店名</label>
      <div class="col-sm-5">
        <input class="form-control" errormsg="这是必填项" datatype="*" value="{$info.susername}" name="susername" type="text" placeholder="商家名称">
        <span class="msgbox"></span>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-2">登录名</label>
      <div class="col-sm-5">
        <input class="form-control" errormsg="这是必填项" datatype="*" value="{$info.login_name}" name="login_name" type="text" placeholder="登录名">
        <span class="msgbox"></span>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-2">商家类型</label>
      <div class="col-sm-5">
        <select name="type"  class="shoptype form-control">
          <option value="1">线上商家</option>
          <option value="2">线下商家</option>
        </select>
      </div>
    </div>
    <script>
      $('.shoptype').change(function(){
          var value=$('.shoptype').val();
          if(value == 2){
              $('.hideshop').show();
          }else{
              $('.hideshop').hide();
          }
      });
    </script>
    <div class="form-group hideshop" style="display: none">
      <label class="control-label col-sm-2">店面图片</label>
      <div class="col-sm-5">
        <html:uploadimg name="img_url"   id="img_url" num="1" value="$info['img_url']"/>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-2">营业执照</label>
      <div class="col-sm-5">
        <html:uploadimg name="licence"   id="licence" num="1" value="$info['licence']"/>
      </div>
    </div>
    
    
    <div class="form-group hideshop" style="display: none">
      <label class="control-label col-sm-2">身份证正面</label>
      <div class="col-sm-5">
        <html:uploadimg name="idcard1"   id="idcard1" num="1" value="$info['idcard1']"/>
      </div>
    </div>
    <div class="form-group hideshop" style="display: none">
      <label class="control-label col-sm-2">身份证反面</label>
      <div class="col-sm-5">
        <html:uploadimg name="idcard2"   id="idcard2" num="1" value="$info['idcard2']"/>
      </div>
    </div>
    
    <div class="form-group">
      <label class="control-label col-sm-2">联系人</label>
      <div  class="col-sm-5">
        <input class="form-control" value="{$info.contacts}" errormsg="请填写信息！"
 datatype="*" name="contacts" type="text" placeholder="联系人">
  <span class="msgbox"></span>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-2">联系电话</label>
      <div class="col-sm-5">
        <input class="form-control" datatype="m" errormsg="请输入正确的手机号码！" name="sphone" value="{$info.sphone}" type="text" placeholder="电话">
         <span class="msgbox"></span>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-2">地区</label>
      <div class="col-sm-10"> <span id="areabox"></span> </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-2">详细地址</label>
      <div class="col-sm-8">
        <input class="form-control" datatype="*" errormsg="这是必填项" value="{$info.saddress}" name="saddress" type="text" placeholder="地址">
         <span class="msgbox"></span>
      </div>
    </div>
   <!-- <div class="form-group">
      <label class="control-label col-sm-2">店名</label>
      <div class="col-sm-6">
        <input class="form-control" value="{$info.shopname}" errormsg="这是必填项" datatype="*" name="shopname" type="text" placeholder="店名">
         <span class="msgbox"></span>
      </div>
    </div>-->
    <div class="form-group">
      
        <label class="control-label col-sm-2">百度地图坐标</label><div class="col-sm-6">
        <input class="form-control" onClick="getbaidumap();" readonly value="{$info.baidumapX},{$info.baidumapY}" name="baidupoint" id="txtPoint" type="text" placeholder="点击获取地理位置">
      </div>
    </div>
    <script type="text/javascript">
// 百度地图API功能  

	function getbaidumap(){
		document.getElementById("txtPoint").value='正在获取坐标';
		var geolocation = new BMap.Geolocation();
		geolocation.getCurrentPosition(function(r){
		if(this.getStatus() == BMAP_STATUS_SUCCESS){
			var x = r.point.lng;
			var y = r.point.lat;
			var zb = x + ',' + y;
			document.getElementById("txtPoint").value=zb; 
		}
		else {
			alert('failed'+this.getStatus());
		}        
	},{enableHighAccuracy: true});
	}
</script>

    <div class="form-group">
      <label class="control-label col-sm-2">人均消费</label>
      <div class="col-sm-5">
        <input class="form-control"   name="avg_money" value="{$info.avg_money}" type="number" placeholder="人均消费">
        <span class="msgbox"></span>
      </div>
    </div>
    <div class="form-group">
      <label class="control-label col-sm-2">备注</label>
      <div class="col-sm-7">
      <textarea name="remark" class="form-control" placeholder="备注">{$info.remark}</textarea>

      </div>
    </div>
    <div class="form-group">
      <button style="width:80%; margin-top:20px; margin-left:auto; margin-right:auto; display:block;" class="btn btn-success" type="submit">保存</button>
    </div>
  </form>
 
</div></div>
<script>

	$(document).ready(function(e) {
        
		<empty name="info['area']">
		$.ajax({
			url:"{:U('getRegion')}",
			data:"",
			type:"POST",
			dataType:"html",
			success: function(data){
				$('#areabox').html(data);
			}
		});
		
		<else/>
		
		
		$.ajax({
			url:"{:U('setRegion')}",
			data:"area={$info.area}",
			type:"POST",
			dataType:"html",
			success: function(data){
				$('#areabox').html(data);
			}
		});
		
		</empty>
    });
	function removnextAll(e){
		if($(e).next().length>0){
			removnextAll($(e).next());
			$(e).next().remove();
		}
	}
	function sendRegion(e){
		if(e.value>0){
			$.ajax({
			url:"{:U('getRegion')}",
			data:"fid="+e.value,
			type:"POST",
			dataType:"html",
				success: function(data){
					removnextAll(e);
					$(e).parent().append(data);
				}
		    });
	    }else{
		    removnextAll(e);
	    }
	    return false;
	}

</script> 

<style>.myBox8109member{
	width:auto;height:80px;background-color:transparent;background-position:center center;background-repeat:no-repeat;margin:0 auto 0 auto;}
.nav-glyphicons-list {
	display: table;
	width: 100%;
	padding-left: 0;
	list-style: none;
}
.nav-glyphicons li {
	display: table-cell;
	text-align: center;
    *display: inline-block;
    +float:left;
    
}
.nav-glyphicons li ul li {
	display: block;
}
.nav-glyphicons li a {
	display: inline-block;
	width: 100%;
    _width:auto;
	padding-top:0.2em;
}
.nav-glyphicons .glyphicon-class {
	display: block;
	text-align: center;
	word-wrap: break-word
}
.nav-glyphicons .dropdown-menu {
	border-radius: 0;
	padding-top: 0;
	padding-bottom: 0;
}
.dropdown-menu{min-width:inherit;}
.myBox8109member ul{background-color:#303030 !important; border-top:1px solid #b3b3b3}  
.myBox8109member ul li a{line-height:1 !important;}
.myBox8109member ul li a span{color:#fff; line-height:22px;}
.myBox8109member ul li a{}
.myBox8109member ul li a span.fa{padding-top:0.3em; font-size:1.5em;}
.myBox8109member ul li.first a{border-left:none;}
.myBox8109member ul li.last a{border-right:none;}

.myBox8109member .dropdown-menu a {
  color: #fff;
  padding: 5px;
}
.myBox8109member ul li a:hover {
  color: #f60;
  background-color: #303030 !important;
}.myBox8109member{}
.myBox8109member ul li a{font-size:14px; color:#000;padding:0; margin:0;line-height:30px}
.myBox8109member ul li a:hover{color:#f60; background-color:#ccc}
.panel.panel-default{border-radius:0;}

.panel-info{border-color: #ff1c51; border-radius:0 !important;}
.panel-info .panel-heading{   border-radius:0 !important;  color: #FFFFFF;
    background-color: #ff1c51;
    border-color: #ff1c51;}

.myBox21349{
	width:auto;height:45px;background-position:center center;background-repeat:no-repeat;margin:0 auto 0 auto;}
.nav-glyphicons-list {
	display: table;
	width: 100%;
	padding-left: 0;
	list-style: none;
}
.nav-glyphicons li {
	display: table-cell;
	text-align: center;
    *display: inline-block;
    +float:left;
    
}
.nav-glyphicons li ul li {
	display: block;
}
.nav-glyphicons li a {
	display: inline-block;
	width: 100%;
    _width:auto;
	padding-top:0.2em;
}
.nav-glyphicons .glyphicon-class {
	display: block;
	text-align: center;
	word-wrap: break-word
}
.nav-glyphicons .dropdown-menu {
	border-radius: 0;
	padding-top: 0;
	padding-bottom: 0;
}
.dropdown-menu{min-width:inherit;}
#jszc{display:none;}
.myBox21349 ul{background-color:#fff !important;border-top: 1px solid #E2E2E2;}
.myBox21349 ul li a{line-height:1 !important;}
.myBox21349 ul li a span{color:#000; line-height:22px;}
.myBox21349 ul li a{border-right:1px solid #fff; border-left:1px solid #fff;}
.myBox21349 ul li a span.fa{padding-top:0.3em; font-size:1.5em;}
.myBox21349 ul li.first a{border-left:none;}
.myBox21349 ul li.last a{border-right:none;}

.myBox21349 .dropdown-menu a {
  color: #fff;
  padding: 5px;
}
.myBox21349 ul li a:hover {
  color: #000;
  background-color: #fff !important;
}.myBox21349 ul li i{font-size:0.5em;}
.myBox21349 ul li i:before{padding-left:4px;}
.myBox21349 ul li.open i:before{content: "\e253"; padding-left:4px;} 
.myBox21349{}
.myBox21349 ul li a{font-size:14px; color:#000;padding:0; line-height:30px}
.myBox21349 ul li a:hover{color:#f60; background-color:#ccc}.myBox26056{
	width:auto;height:45px;background-position:center center;background-repeat:no-repeat;margin:0 auto 0 auto;}

  </style>








<script>//请求关注提醒信息
$.get('<?php echo U('Home/Ajax/subscribeaff');?>',{},function(data){
	$(document).find('body').before(data);
},'html');</script>

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
//请求关注提醒信息
$.post('<?php echo U('Home/Ajax/getJsSdk');?>',{url:window.location.href},function(data){
	//$(document).find('body').append(data);
	//alert(data.signature);
	//alert(data.rawString);
	wx.config({
		//debug: true,
		appId: data.appId,
		timestamp: data.timestamp,
		nonceStr: data.nonceStr,
		signature: data.signature,
		jsApiList: [
		  // 所有要调用的 API 都要加到这个列表中
		  
		  'onMenuShareTimeline',
		  'onMenuShareAppMessage',
		 
		]
	});
	wx.ready(function () {
	  var shareData = {
		title: '<?php echo getPageTitle();?>',
		desc: '<?php echo getPageDescription();?>',
		link: '<?php echo U('', array('aff_id' => $_SESSION['memberInfo']['id']), true, false, true);?>',
		imgUrl: '<?php echo getPageLogo();?>',
		success: function () { 
        // 用户确认分享后执行的回调函数
		    $.post('<?php echo U('Home/Ajax/weixinshare');?>',{url:'<?php echo U('', array('aff_id' => $_SESSION['memberInfo']['id']), true, false, true);?>'}, function(){
				//success('分享成功！');
			});
        }
	  };
	  wx.onMenuShareAppMessage(shareData);
	  wx.onMenuShareTimeline(shareData);
	});
},'json');


function showform(){
	$('#formbox').show();
	$('#fbox').hide();
}

</script>


<script src="/static/js/dropzone/dropzone.min.js"></script>
<script src="/Public/setajax.js?v=2"></script> 
<script>
    $('.checkoutform').ajaxsubmit({returnform:false});
</script> 
</body></html>